package isp.apps.example.shoppingcart.domain;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class UsStates
{
  private static List usStates;

  private UsStates()
  {
  }
  
  public static List getUsStatesOrderedByName()
  {
    Collections.sort(usStates,new Comparator()
                      {
                        public int compare(Object usState1, Object usState2)
                        {
                           return ((UsState)usState1).getName().compareTo(((UsState)usState2).getName());
                        }
                      });
    return usStates;
  }
  
  public static List getUsStatesOrderedByAbbreviation()
  {
    Collections.sort(usStates,new Comparator()
                      {
                        public int compare(Object usState1, Object usState2)
                        {
                           return ((UsState)usState1).getAbbreviation().compareTo(((UsState)usState2).getAbbreviation());
                        }
                      });
    return usStates;
  }
  
  static
  {
    usStates = new ArrayList(50);   
    usStates.add(new UsState("Alaska","AK"));
    usStates.add(new UsState("Alabama","AL"));
    usStates.add(new UsState("Arkansas","AR"));
    usStates.add(new UsState("Arizona","AZ"));
    usStates.add(new UsState("California","CA"));
    usStates.add(new UsState("Colorado","CO"));
    usStates.add(new UsState("Connecticut","CT"));
    usStates.add(new UsState("Delaware","DE"));
    usStates.add(new UsState("Florida","FL"));
    usStates.add(new UsState("Georgia","GA"));
    usStates.add(new UsState("Hawaii","HI"));
    usStates.add(new UsState("Iowa","IA"));
    usStates.add(new UsState("Idaho","ID"));
    usStates.add(new UsState("Illinois","IL"));
    usStates.add(new UsState("Indiana","IN"));
    usStates.add(new UsState("Kansas","KS"));
    usStates.add(new UsState("Kentucky","KY"));
    usStates.add(new UsState("Louisiana","LA"));
    usStates.add(new UsState("Massachusetts","MA"));
    usStates.add(new UsState("Maryland","MD"));
    usStates.add(new UsState("Maine","ME"));
    usStates.add(new UsState("Michigan","MI"));
    usStates.add(new UsState("Minnesota","MN"));
    usStates.add(new UsState("Missouri","MO"));
    usStates.add(new UsState("Mississippi","MO"));
    usStates.add(new UsState("Montana","MO"));
    usStates.add(new UsState("North Carolina","MO"));
    usStates.add(new UsState("North Dakota","ND"));
    usStates.add(new UsState("Nebraska","NE"));
    usStates.add(new UsState("New Hampshire","NH"));
    usStates.add(new UsState("New Jersey","NJ"));
    usStates.add(new UsState("New Mexico","NM"));
    usStates.add(new UsState("Nevada","NV"));
    usStates.add(new UsState("New York","NY"));
    usStates.add(new UsState("Ohio","OH"));
    usStates.add(new UsState("Oklahoma","OK"));
    usStates.add(new UsState("Oregon","OR"));
    usStates.add(new UsState("Pennsylvania","PA"));
    usStates.add(new UsState("Rhode Island","RI"));
    usStates.add(new UsState("South Carolina","SC"));
    usStates.add(new UsState("South Dakota","SD"));
    usStates.add(new UsState("Tennessee","TN"));
    usStates.add(new UsState("Texas","TX"));
    usStates.add(new UsState("Utah","UT"));
    usStates.add(new UsState("Virginia","VA"));
    usStates.add(new UsState("Vermont","VT"));
    usStates.add(new UsState("Washington","WA"));
    usStates.add(new UsState("Wisconsin","WI"));
    usStates.add(new UsState("West Virginia","WV"));
    usStates.add(new UsState("Wyoming","WY"));
    usStates.add(new UsState("District of Columbia","DC"));
    usStates.add(new UsState("American Samoa","AS"));
    usStates.add(new UsState("Guam","GU"));
    usStates.add(new UsState("Northern Mariana Islands","MP"));
    usStates.add(new UsState("Puerto Rico","PR"));
    usStates.add(new UsState("U.S. Virgin Islands","VI"));
    usStates.add(new UsState("Federated States of Micronesia","FM"));
    usStates.add(new UsState("Marshall Islands","MH"));
    usStates.add(new UsState("Palau","PW"));
    usStates.add(new UsState("Armed Forces Americas (except Canada)","AA"));
    usStates.add(new UsState("Armed Forces Europe (covers all USARAEUR)","AE"));    
    usStates.add(new UsState("Armed Forces Pacific","AP"));
  }
}
